package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.mapper.HmzItemMapper;
import com.ruoyi.system.service.IHmzItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.HmzInventoryDetailMapper;
import com.ruoyi.system.domain.HmzInventoryDetail;
import com.ruoyi.system.service.IHmzInventoryDetailService;

/**
 * 盘点单子Service业务层处理
 *
 * @author ruoyi
 * @date 2024-10-30
 */
@Service
public class HmzInventoryDetailServiceImpl implements IHmzInventoryDetailService
{
    @Autowired
    private HmzInventoryDetailMapper hmzInventoryDetailMapper;
    @Autowired
    private HmzItemMapper hmzItemMapper ;

    /**
     * 查询盘点单子
     *
     * @param id 盘点单子主键
     * @return 盘点单子
     */
    @Override
    public HmzInventoryDetail selectHmzInventoryDetailById(Long id)
    {
        return hmzInventoryDetailMapper.selectHmzInventoryDetailById(id);
    }

    /**
     * 查询盘点单子列表
     *
     * @param hmzInventoryDetail 盘点单子
     * @return 盘点单子
     */
    @Override
    public List<HmzInventoryDetail> selectHmzInventoryDetailList(HmzInventoryDetail hmzInventoryDetail)
    {
        List<HmzInventoryDetail> hmzInventoryDetails = hmzInventoryDetailMapper.selectHmzInventoryDetailList(hmzInventoryDetail);
        return hmzInventoryDetails;
    }

    /**
     * 新增盘点单子
     *
     * @param hmzInventoryDetail 盘点单子
     * @return 结果
     */
    @Override
    public int insertHmzInventoryDetail(HmzInventoryDetail hmzInventoryDetail)
    {
        hmzInventoryDetail.setCreateTime(DateUtils.getNowDate());
        return hmzInventoryDetailMapper.insertHmzInventoryDetail(hmzInventoryDetail);
    }

    /**
     * 修改盘点单子
     *
     * @param hmzInventoryDetail 盘点单子
     * @return 结果
     */
    @Override
    public int updateHmzInventoryDetail(HmzInventoryDetail hmzInventoryDetail)
    {
        hmzInventoryDetail.setUpdateTime(DateUtils.getNowDate());
        return hmzInventoryDetailMapper.updateHmzInventoryDetail(hmzInventoryDetail);
    }

    /**
     * 批量删除盘点单子
     *
     * @param ids 需要删除的盘点单子主键
     * @return 结果
     */
    @Override
    public int deleteHmzInventoryDetailByIds(Long[] ids)
    {
        return hmzInventoryDetailMapper.deleteHmzInventoryDetailByIds(ids);
    }

    /**
     * 删除盘点单子信息
     *
     * @param id 盘点单子主键
     * @return 结果
     */
    @Override
    public int deleteHmzInventoryDetailById(Long id)
    {
        return hmzInventoryDetailMapper.deleteHmzInventoryDetailById(id);
    }
}
